var server = {
    //ip: "http://129.211.82.198:8080"
    ip: "https://www.yyyybook.club:80"
}

var currentUser = null;
var isLoad=true;
var storage = window.localStorage;
function setCurrentUser(user) {
  if (window.localStorage) {
    var userJsonStr = JSON.stringify(user)
    storage.setItem('user', userJsonStr)
  } else {
    alert('当前浏览器不支持localStorage,请升级')
  }
};
function getCurrentUser() {
  if (currentUser !== null) {
    return currentUser
  } else {
    var userJsonStr = storage.getItem('user');
    currentUser = JSON.parse(userJsonStr);
    if (currentUser === null) {
      return null;
    } else {
      return currentUser;
    }
  }
}

//监听F5刷新
var check=function(e){
  e=e||window.event;
  if((e.which||e.keyCode)==116){
    if(e.preventDefault){
      e.preventDefault();
      parent.frames["blank"].location.reload();//window.frames["blank"].location.reload();
    } else{
      event.keyCode = 0;
      e.returnValue=false;
      window.location.reload();
    }
  }
}
if(document.addEventListener){
  document.addEventListener("keydown",check,false);
} else{
  document.attachEvent("onkeydown",check);
}
